<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>获取请求</title>
  <!-- jquery -->
  <script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.7.1/jquery.js"></script>
</head>

<body>
  <script>
    // 请求方式1 :fetch
    const url = 'http://39.103.151.139:8000/cart'
    // fetch(url).then(res => res.json()).then(data => { console.log(data) })
    //请求方式2 :jquery
    $.ajax({
      url,
      success: res => {
        console.log(res);
      }
    })
  </script>
</body>

</html>